package com.mwumz.third.controller;

import com.mwumz.third.common.Response;
import com.mwumz.third.service.ScottMapService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: wumz
 * 对接高德地图
 * @Date: 2020/7/2 13:44
 * @Version 1.0
 */
/**
 * 对接高德地图
 * created by dongyangyang
 */
@SuppressWarnings("all")
@Api
@RequestMapping(value = "scottMap")
@RestController
public class ScottMapApi {

    @Autowired
    private ScottMapService scottMapService;

    @ApiOperation(value = "根据物理地址获取经纬度/地理编码")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "address",value = "支持多个地址（国家、省份、城市、区县、城镇、乡村、街道、门牌号码、屋邨、大厦）,多个地址之间用”|”进行分隔最多支持10个",
                    example = "上海市军工路2500号|北京市朝阳区阜通东大街6号",paramType = "query",dataType = "String",required = true)
    })
    @RequestMapping(value = "getLocation", method = RequestMethod.GET)
    public Response getLocation(@ApiParam("地址")@RequestParam(value = "address")String address){
        return Response.success(scottMapService.getLocation(address));
    }


}
